//
//  GourmetFierdViewController.m
//  ForengnMenu
//
//  Created by wenzhaoxu on 16/1/23.
//  Copyright © 2016年 余旺. All rights reserved.
//

#import "GourmetFierdViewController.h"
#import "GourmetFierdTableViewCell.h"
#import "OtherInfoViewController.h"

@interface GourmetFierdViewController ()<UITableViewDataSource,UITableViewDelegate>

@property NSArray * array;

@end

@implementation GourmetFierdViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.title = @"人气美食家";
    
    NSDictionary * dic1 =@{@"image":@"1.jpg",
                           @"name" :@"摇摇妈妈",
                           @"sex":@"女 25岁 湖南 长沙",
                           @"title" :@" 账号信息:",
                           @"content" : @"49252313",
                           @"title1" : @"个性签名:",
                           @"content1" : @"我是位全职妈妈，我来的目的是：学习、学习、再学习！",
                           @"title2" : @"他的二维码:",
                           @"content2" : @""
                           
                           };
    
    NSDictionary * dic2 =@{@"image":@"2.jpg",
                           @"name" :@"随遇而安",
                           @"sex":@"男 23岁 湖北 天津",
                           @"title" :@"账号信息:",
                           @"content" : @"364525375",
                           @"title1" : @"个性签名:",
                           @"content1" : @"吃好营养健康才是根本",
                           @"title2" : @"他的二维码:",
                           @"content2" : @""
                           };
    
    NSDictionary * dic3 =@{@"image":@"3.jpg",
                           @"name" :@"prows",
                           @"sex":@"女 28岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"很高兴加入你们",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""
                           
                           };
    NSDictionary * dic4 =@{@"image":@"4.jpg",
                           @"name" :@"思凡",
                           @"sex":@"女 28岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"用饮食维护家人健康，做合格的厨娘;",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""
                           
                           };
    NSDictionary * dic5 =@{@"image":@"5.jpg",
                           @"name" :@"美厨小叔",
                           @"sex":@"女 28岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"作为吃货，就是会吃、能吃、敢吃、爱吃。",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""
                           
                           };
    NSDictionary * dic6 =@{@"image":@"6.jpg",
                           @"name" :@"西餐厨",
                           @"sex":@"女 28岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"爱生活、爱厨房、这就是我",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""
                           
                           };
    NSDictionary * dic7 =@{@"image":@"7.jpg",
                           @"name" :@"Desdemons",
                           @"sex":@"女 28岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"很高兴加入你们",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""
                           
                           };
    NSDictionary * dic8 =@{@"image":@"8.jpg",
                           @"name" :@"叶姑娘_Eeon",
                           @"sex":@"女 28岁 北京",
                           @"title" :@"账号信息:",
                           @"content" : @"563425327",
                           @"title1" : @"个性签名:",
                           @"content1" : @"唯有爱与美食不可辜负。",
                           @"title2" : @"她的二维码:",
                           @"content2" : @""
                           
                           };


    self.array = @[dic1,dic2,dic3,dic4,dic5,dic6,dic7,dic8];

}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    
    return self.array.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static  NSString * identifier = @"Cell";
    
    GourmetFierdTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:identifier];

    NSDictionary * info = self.array[indexPath.row];
    
    cell.headIMageView.image = [UIImage imageNamed:info[@"image"]];
    
    cell.nameLabel.text = info[@"name"];
    
    cell.mingYan.text = info[@"content1"];
    
    return cell;

}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    [tableView deselectRowAtIndexPath:indexPath animated:YES];
    
    UIStoryboard * stroyboard = [UIStoryboard storyboardWithName:@"RootViewController" bundle:[NSBundle mainBundle]];
    
    OtherInfoViewController * viewController = [stroyboard instantiateViewControllerWithIdentifier:@"UserInfoViewController"];
    viewController.info = self.array[indexPath.row];
    
    [self.navigationController pushViewController:viewController animated:YES];

}



@end
